﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class Dictionary
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            HttpSessionState session = System.Web.HttpContext.Current.Session;
            HttpRequest request = System.Web.HttpContext.Current.Request;
            pg.dict = BasePage.getDict(session);
            pg.Type = "Dictionary";
            pg.Title = "数据字典";
            pg.AddText = "数据字典增加";
            pg.EditText = "数据字典修改";
            pg.LocateText = "数据字典信息查询";
            pg.SMenuId = "CS08";
            pg.FileUrl = "../Sys/Dictionary";
            pg.Condition = "";
            pg.TableName = "tb_sys_dictionary";
            pg.KeyFieldName = "did";
            pg.PopEditHeight = 290;
            pg.PopEditWidth = 360;
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
            pg.Condition = String.Format(" and typeid='{0}' ", request["typeid"]);
            pg.UrlAddPara = "typeid=" + request["typeid"];
            pg.UrlEditPara = "typeid=" + request["typeid"];
            pg.Sql = "select * from tb_sys_dictionary where 1=1 ";

            ColumnInfo cl;
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "did"; cl.HeadText = "数据代码"; cl.IsCondition = true; cl.Style = "width:200px"; cl.IsCheck = true; cl.Length = 200; cl.IsNull = false; cl.ErrMessage = "数据代码:必填且长度不能超过50"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "dname"; cl.HeadText = "数据名称"; cl.IsCondition = true; cl.IsCheck = true; cl.Length = 50; cl.ErrMessage = "数据名称:长度不能超过50"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "helpcode"; cl.HeadText = "备注"; cl.IsCondition = true; cl.IsCheck = true; cl.Length = 50; cl.ErrMessage = "备注:长度不能超过50"; pg.AddColumn(cl);
            return pg;
        }
    }
}